import {
    Button,
    Input,
    Carousel,
    CarouselItem,
    Message,
    Badge,
    Tabs,
    TabPane
} from 'element-ui'

export default function registerElementui(Vue) {
    Vue.use(Button)
    Vue.use(Input)
    Vue.use(Carousel)
    Vue.use(CarouselItem)
    Vue.use(Badge)
    Vue.use(Tabs)
    Vue.use(TabPane)

    Vue.prototype.$message = Message
    messgeToast(Vue)
}

function messgeToast(Vue) {
    Vue.prototype.$success = msg => {
        return Message({
            type: 'success',
            message: msg
        })
    }
    Vue.prototype.$warning = msg => {
        return Message({
            type: 'warning',
            message: msg
        })
    }
    Vue.prototype.$error = msg => {
        return Message({
            type: 'error',
            message: msg
        })
    }
}